Skip to content

field2property rework#199

Merged
sloria merged 5 commits into
marshmallow-code:devfrom
Nobatek:dev_jl_field2property_rework
Apr 11, 2018
Merged

field2property rework#199
sloria merged 5 commits into
marshmallow-code:devfrom
Nobatek:dev_jl_field2property_rework

Conversation

@lafrech

@lafrech lafrech commented Apr 9, 2018

Copy link
Copy Markdown
Member

This PR reworks field2property a bit to provide more consistency to the field2attribute methods. This makes it easier to manage different OpenAPI versions.

It also adds the x-nullable/nullable and writeOnly attributes depending on the version.

It does not address the optional spec attribute issue discussed in #197 but it is a first step.

@sloria, @Bangertm Feedback welcome.

@sloria sloria left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this approach is a big improvement. +1 to moving OpenAPI 3 work forward, too. Nice!

return attributes


def field2write_only(field, **kwargs):

@lafrech lafrech Apr 10, 2018

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was Python 3 only, I'd write

def field2write_only(field, *, openapi_major_version, **kwargs):

@lafrech

lafrech commented Apr 10, 2018

Copy link
Copy Markdown
Member Author

Great. Shall I merge this, then?

@sloria

sloria commented Apr 11, 2018

Copy link
Copy Markdown
Member

LGTM 🚢 🇮🇹

@sloria
sloria merged commit bcbee87 into marshmallow-code:dev Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants